home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGIALS / PTUTOR2B.LZH / FORWARD.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  626b  |  27 lines

  1.                                 (* Chapter 5 - Program 8 *)
  2. program Forward_Reference_Example;
  3.  
  4. var Number_Of_Times : integer;
  5.  
  6. procedure Write_A_Line(var Count : integer); forward;
  7.  
  8. procedure Decrement(var Index : integer);
  9. begin
  10.    Index := Index - 1;
  11.    if Index > 0 then
  12.       Write_A_Line(Index);
  13. end;
  14.  
  15. procedure Write_A_Line;
  16. begin
  17.    Writeln('The value of the count is now ',Count:4);
  18.    Decrement(Count);
  19. end;
  20.  
  21. begin  (* main program *)
  22.    Number_Of_Times := 7;
  23.    Decrement(Number_Of_Times);
  24.    Writeln;
  25.    Number_Of_Times := 7;
  26.    Write_A_Line(Number_Of_Times);
  27. end.  (* of main program *)